AmCharts.AmFunnelChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(t){this.type="funnel";AmCharts.AmFunnelChart.base.construct.call(this,t);this.cname="AmFunnelChart";this.startX=this.startY=0;this.baseWidth="100%";this.neckHeight=this.neckWidth=0;this.rotate=!1;this.valueRepresents="height";this.pullDistance=30;this.labelPosition="center";this.labelText="[[title]]: [[value]]";this.balloonText="[[title]]: [[value]]\n[[description]]";AmCharts.applyTheme(this,t,this.cname)},drawChart:function(){AmCharts.AmFunnelChart.base.drawChart.call(this);var t=this.chartData;if(AmCharts.ifArray(t))if(0<this.realWidth&&0<this.realHeight){var a=Math.round(this.depth3D*Math.cos(this.angle*Math.PI/180)),h=Math.round(-this.depth3D*Math.sin(this.angle*Math.PI/180)),i=this.container,s=this.startDuration,e=this.rotate,r=this.updateWidth();this.realWidth=r;var n=this.updateHeight();this.realHeight=n;var o=AmCharts.toCoordinate,l=o(this.marginLeft,r),d=o(this.marginRight,r),u=o(this.marginTop,n)+this.getTitleHeight(),o=o(this.marginBottom,n);0<a&&0>h&&(this.neckHeight=this.neckWidth=0,e?o-=h/2:u-=h/2);var d=r-l-d,m=AmCharts.toCoordinate(this.baseWidth,d),c=AmCharts.toCoordinate(this.neckWidth,d),p=n-o-u,C=AmCharts.toCoordinate(this.neckHeight,p),g=u+p-C;e&&(u=n-o,g=u-p+C);this.firstSliceY=u;AmCharts.VML&&(this.startAlpha=1);for(var A=d/2+l,f=(p-C)/((m-c)/2),b=1,M=m/2,m=(p-C)*(m+c)/2+c*C,v=u,y=0,C=0;C<t.length;C++){var w=t[C],L;if(!0!==w.hidden){var x=[],R=[],T;if("height"==this.valueRepresents)T=p*w.percents/100;else{var H=-m*w.percents/100/2,k=M;L=-1/(2*f);T=Math.pow(k,2)-4*L*H;0>T&&(T=0);T=(Math.sqrt(T)-k)/(2*L);if(!e&&u>=g||e&&u<=g)T=2*-H/c;else if(!e&&u+T>g||e&&u-T<g)L=e?Math.round(T+(u-T-g)):Math.round(T-(u+T-g)),T=L/f,T=L+2*(-H-(k-T/2)*L)/c}H=M-T/f;k=!1;!e&&u+T>g||e&&u-T<g?(H=c/2,x.push(A-M,A+M,A+H,A+H,A-H,A-H),e?(L=T+(u-T-g),u<g&&(L=0),R.push(u,u,u-L,u-T,u-T,u-L,u)):(L=T-(u+T-g),u>g&&(L=0),R.push(u,u,u+L,u+T,u+T,u+L,u)),k=!0):(x.push(A-M,A+M,A+H,A-H),e?R.push(u,u,u-T,u-T):R.push(u,u,u+T,u+T));i.set();L=i.set();0<a&&0>h?(x=H/M,R=-1,e||(R=1),wedgeGraphics=new AmCharts.Cuboid(i,2*M,R*T,a,h*b,w.color,w.alpha,this.outlineThickness,this.outlineColor,this.outlineAlpha,90,0,!1,0,w.pattern,x).set,wedgeGraphics.translate(A-M,u-h/2*b),b*=x):wedgeGraphics=AmCharts.polygon(i,x,R,w.color,w.alpha,this.outlineThickness,this.outlineColor,this.outlineAlpha);L.push(wedgeGraphics);this.graphsSet.push(L);e||L.toBack();w.wedge=L;w.index=C;if(x=this.gradientRatio){var R=[],W;for(W=0;W<x.length;W++)R.push(AmCharts.adjustLuminosity(w.color,x[W]));0<R.length&&wedgeGraphics.gradient("linearGradient",R);w.pattern&&wedgeGraphics.pattern(w.pattern)}0<s&&(this.chartCreated||L.setAttr("opacity",this.startAlpha));this.addEventListeners(L,w);w.ty0=u-T/2;if(this.labelsEnabled&&this.labelText&&w.percents>=this.hideLabelsPercent){R=this.formatString(this.labelText,w);(x=this.labelFunction)&&(R=x(w,R));W=w.labelColor;W||(W=this.color);var x=this.labelPosition,B="left";"center"==x&&(B="middle");"left"==x&&(B="right");R=AmCharts.wrappedText(i,R,W,this.fontFamily,this.fontSize,B,!1,this.maxLabelWidth);R.node.style.pointerEvents="none";L.push(R);W=A;e?(B=u-T/2,w.ty0=B):(B=u+T/2,w.ty0=B,B<v+y+5&&(B=v+y+5),B>n-o&&(B=n-o));"right"==x&&(W=d+10+l,w.tx0=A+(M-T/2/f),k&&(w.tx0=A+H));"left"==x&&(w.tx0=A-(M-T/2/f),k&&(w.tx0=A-H),W=l);w.label=R;w.labelX=W;w.labelY=B;w.labelHeight=R.getBBox().height;R.translate(W,B);M=R.getBBox();v=AmCharts.rect(i,M.width+5,M.height+5,"#ffffff",.005);v.translate(W+M.x,B+M.y);L.push(v);w.hitRect=v;y=R.getBBox().height;v=B}(0===w.alpha||0<s&&!this.chartCreated)&&L.hide();u=e?u-T:u+T;M=H;w.startX=AmCharts.toCoordinate(this.startX,r);w.startY=AmCharts.toCoordinate(this.startY,n);w.pullX=AmCharts.toCoordinate(this.pullDistance,r);w.pullY=0;w.balloonX=A;w.balloonY=w.ty0}}this.arrangeLabels();this.initialStart();(t=this.legend)&&t.invalidateSize()}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},arrangeLabels:function(){var t=this.rotate,a;a=t?0:this.realHeight;for(var h=0,i=this.chartData,s=i.length,e,r=0;r<s;r++){e=i[s-r-1];var n=e.label,o=e.labelY,l=e.labelX,d=e.labelHeight,u=o;t?a+h+5>o&&(u=a+h+5):o+d+5>a&&(u=a-5-d);a=u;h=d;if(n){n.translate(l,u);var m=n.getBBox()}e.hitRect.translate(l+m.x,u+m.y);e.labelY=u;e.tx=l;e.ty=u;e.tx2=l}"center"!=this.labelPosition&&this.drawTicks()}});AmCharts.Cuboid=AmCharts.Class({construct:function(t,a,h,i,s,e,r,n,o,l,d,u,m,c,p,C){this.set=t.set();this.container=t;this.h=Math.round(h);this.w=Math.round(a);this.dx=i;this.dy=s;this.colors=e;this.alpha=r;this.bwidth=n;this.bcolor=o;this.balpha=l;this.dashLength=c;this.topRadius=C;this.pattern=p;(this.rotate=m)?0>a&&0===d&&(d=180):0>h&&270==d&&(d=90);this.gradientRotation=d;0===i&&0===s&&(this.cornerRadius=u);this.draw()},draw:function(){var t=this.set;t.clear();var a=this.container,h=this.w,i=this.h,s=this.dx,e=this.dy,r=this.colors,n=this.alpha,o=this.bwidth,l=this.bcolor,d=this.balpha,u=this.gradientRotation,m=this.cornerRadius,c=this.dashLength,p=this.pattern,C=this.topRadius,g=r,A=r;"object"==typeof r&&(g=r[0],A=r[r.length-1]);var f,b,M,v,y,w,L,x,R,T=n;p&&(n=0);var H,k,W,B,F=this.rotate;if(0<Math.abs(s)||0<Math.abs(e))if(isNaN(C))L=A,A=AmCharts.adjustLuminosity(g,-.2),A=AmCharts.adjustLuminosity(g,-.2),f=AmCharts.polygon(a,[0,s,h+s,h,0],[0,e,e,0,0],A,n,1,l,0,u),0<d&&(R=AmCharts.line(a,[0,s,h+s],[0,e,e],l,d,o,c)),b=AmCharts.polygon(a,[0,0,h,h,0],[0,i,i,0,0],A,n,1,l,0,u),b.translate(s,e),0<d&&(M=AmCharts.line(a,[s,s],[e,e+i],l,d,o,c)),v=AmCharts.polygon(a,[0,0,s,s,0],[0,i,i+e,e,0],A,n,1,l,0,u),y=AmCharts.polygon(a,[h,h,h+s,h+s,h],[0,i,i+e,e,0],A,n,1,l,0,u),0<d&&(w=AmCharts.line(a,[h,h+s,h+s,h],[0,e,i+e,i],l,d,o,c)),A=AmCharts.adjustLuminosity(L,.2),L=AmCharts.polygon(a,[0,s,h+s,h,0],[i,i+e,i+e,i,i],A,n,1,l,0,u),0<d&&(x=AmCharts.line(a,[0,s,h+s],[i,i+e,i+e],l,d,o,c));else{var Y,j,D;F?(Y=i/2,A=s/2,D=i/2,j=h+s/2,k=Math.abs(i/2),H=Math.abs(s/2)):(A=h/2,Y=e/2,j=h/2,D=i+e/2+1,H=Math.abs(h/2),k=Math.abs(e/2));W=H*C;B=k*C;.1<H&&.1<H&&(f=AmCharts.circle(a,H,g,n,o,l,d,!1,k),f.translate(A,Y));.1<W&&.1<W&&(L=AmCharts.circle(a,W,AmCharts.adjustLuminosity(g,.5),n,o,l,d,!1,B),L.translate(j,D))}n=T;1>Math.abs(i)&&(i=0);1>Math.abs(h)&&(h=0);!isNaN(C)&&(0<Math.abs(s)||0<Math.abs(e))?(r=[g],r={fill:r,stroke:l,"stroke-width":o,"stroke-opacity":d,"fill-opacity":n},F?(n="M0,0 L"+h+","+(i/2-i/2*C),o=" B",0<h&&(o=" A"),AmCharts.VML?(n+=o+Math.round(h-W)+","+Math.round(i/2-B)+","+Math.round(h+W)+","+Math.round(i/2+B)+","+h+",0,"+h+","+i,n=n+(" L0,"+i)+(o+Math.round(-H)+","+Math.round(i/2-k)+","+Math.round(H)+","+Math.round(i/2+k)+",0,"+i+",0,0")):(n+="A"+W+","+B+",0,0,0,"+h+","+(i-i/2*(1-C))+"L0,"+i,n+="A"+H+","+k+",0,0,1,0,0"),H=90):(o=h/2-h/2*C,n="M0,0 L"+o+","+i,AmCharts.VML?(n="M0,0 L"+o+","+i,o=" B",0>i&&(o=" A"),n+=o+Math.round(h/2-W)+","+Math.round(i-B)+","+Math.round(h/2+W)+","+Math.round(i+B)+",0,"+i+","+h+","+i,n+=" L"+h+",0",n+=o+Math.round(h/2+H)+","+Math.round(k)+","+Math.round(h/2-H)+","+Math.round(-k)+","+h+",0,0,0"):(n+="A"+W+","+B+",0,0,0,"+(h-h/2*(1-C))+","+i+"L"+h+",0",n+="A"+H+","+k+",0,0,1,0,0"),H=180),a=a.path(n).attr(r),a.gradient("linearGradient",[g,AmCharts.adjustLuminosity(g,-.3),AmCharts.adjustLuminosity(g,-.3),g],H),F?a.translate(s/2,0):a.translate(0,e/2)):a=0===i?AmCharts.line(a,[0,h],[0,0],l,d,o,c):0===h?AmCharts.line(a,[0,0],[0,i],l,d,o,c):0<m?AmCharts.rect(a,h,i,r,n,o,l,d,m,u,c):AmCharts.polygon(a,[0,0,h,h,0],[0,i,i,0,0],r,n,o,l,d,u,!1,c);h=isNaN(C)?0>i?[f,R,b,M,v,y,w,L,x,a]:[L,x,b,M,v,y,f,R,w,a]:F?0<h?[f,a,L]:[L,a,f]:0>i?[f,a,L]:[L,a,f];for(i=0;i<h.length;i++)(s=h[i])&&t.push(s);p&&a.pattern(p)},width:function(t){this.w=Math.round(t);this.draw()},height:function(t){this.h=Math.round(t);this.draw()},animateHeight:function(t,a){var h=this;h.easing=a;h.totalFrames=Math.round(1e3*t/AmCharts.updateRate);h.rh=h.h;h.frame=0;h.height(1);setTimeout(function(){h.updateHeight.call(h)},AmCharts.updateRate)},updateHeight:function(){var t=this;t.frame++;var a=t.totalFrames;t.frame<=a&&(a=t.easing(0,t.frame,1,t.rh-1,a),t.height(a),setTimeout(function(){t.updateHeight.call(t)},AmCharts.updateRate))},animateWidth:function(t,a){var h=this;h.easing=a;h.totalFrames=Math.round(1e3*t/AmCharts.updateRate);h.rw=h.w;h.frame=0;h.width(1);setTimeout(function(){h.updateWidth.call(h)},AmCharts.updateRate)},updateWidth:function(){var t=this;t.frame++;var a=t.totalFrames;t.frame<=a&&(a=t.easing(0,t.frame,1,t.rw-1,a),t.width(a),setTimeout(function(){t.updateWidth.call(t)},AmCharts.updateRate))}});
//# sourceMappingURL=funnel.map.js